package edu.zut.hb.software.together.service.impl;

import java.util.ArrayList;
import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import edu.zut.hb.software.base.service.impl.GenericManagerImpl;
import edu.zut.hb.software.together.dao.FriendDao;
import edu.zut.hb.software.together.domain.Friend;
import edu.zut.hb.software.together.service.FriendService;


@Service
@Transactional
public class FriendServiceImpl extends GenericManagerImpl<Friend,Long> implements FriendService {

    FriendDao friendDao;

    @Autowired
    public void setFriendDao(FriendDao friendDao) {
        this.friendDao = friendDao;
        this.dao=this.friendDao;
    }

    @Override
    public List list() {
        List list = new ArrayList();
        for (int i = 0; i < 10; i++) {
            Friend friend = new Friend();
            friend.setName("第"+i+"朋友");
            friend.setNum(i);
            friend.setStatus(true);
            list.add(friend);
        }
        return list;
    }
}
